package jm.data.structure.set;

/**
 * @Description
 * @date 2022/4/23 14:46
 */
public class ListSetMain {

    public static void main(String[] args) {
        Set<Integer> set = new ListSet<>();
        for (int i = 0; i < 10; i++) {
            set.add(i);
        }
        set.traversal(new Set.Visitor<Integer>() {
            @Override
            public boolean visit(Integer integer) {
                System.out.println(integer);
                return false;
            }
        });
        set.add(1);
        System.out.println("----------------------------------");
        set.traversal(new Set.Visitor<Integer>() {
            @Override
            public boolean visit(Integer integer) {
                System.out.println(integer);
                return false;
            }
        });
        System.out.println("----------------------------------");
        set.remove(1);
        set.traversal(new Set.Visitor<Integer>() {
            @Override
            public boolean visit(Integer integer) {
                System.out.println(integer);
                return false;
            }
        });
    }

}
